home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacMETH 3.2.1 / MacMETH Manual 1992 / Manual Examples / PrintExample.MOD < prev    next >
Encoding:
Text File  |  1992-10-09  |  1.1 KB  |  39 lines  |  [TEXT/MEDT]

  1. MODULE PrintExample; (* demonstrates the access to the printer. *)
  2.  
  3.       FROM Printer IMPORT    OpenPrinter, Reset, ClosePrinter, PrintScreen,
  4.                           PrintWindow, WriteString, WriteLn, Write;
  5.                       
  6.       IMPORT InOut;
  7.   
  8.       CONST FF = 14C;  (* FF = Form feed *)
  9.   
  10.       VAR     ok : BOOLEAN;
  11.                   ch : CHAR;
  12.       
  13. BEGIN
  14.       OpenPrinter(ok);
  15.       IF ok THEN
  16.         Reset;
  17.         InOut.WriteString("This is a screendump. The whole screen is printed.");
  18.         PrintScreen;
  19.         InOut.WriteLn;
  20.         InOut.WriteString("Type a key to continue : ");
  21.         InOut.Read(ch);
  22.         InOut.Write(FF);
  23.         InOut.WriteString("This was a FF written to the 'Terminal' window.");
  24.         Write(FF);
  25.         WriteString("This was a FF written to the printer!");
  26.         WriteLn;
  27.         WriteString("Now the terminal window is printed.");
  28.         WriteLn;
  29.         InOut.WriteString("Type a key to continue : ");
  30.         InOut.Read(ch);
  31.         PrintWindow(NIL,TRUE);
  32.         WriteString("End of printer demo.");
  33.         ClosePrinter;
  34.       ELSE
  35.         (* Link to printer could not be established (printer off ?) *)
  36.       END (* IF *);
  37. END PrintExample.
  38.  
  39.